<extend name="Base/common" />
<block name="body">
<div class="page-container">
  <div class="text-c"> 
    <form action="#" method="post">
      <input type="hidden" name="s_aid" value="{$aid}">
      <input type="hidden" name="s_start_time" value="{$start_time}">
      <input type="hidden" name="s_end_time" value="{$end_time}">
      <input type="hidden" name="s_trade_no" value="{$trade_no}">
      <span class="select-box inline">
        <select name="aid" class="select">
          <option value="0">全部</option>
          <foreach name="agent_list" item="item">
          <option value="{$item['id']}" <if condition="$aid eq $item['id']">selected</if>>{$item['username']}</option>
          </foreach>
        </select>
      </span>
      日期范围：
      <input type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" id="start_time" name="start_time" class="input-text Wdate" style="width:120px;" autocomplete="off" value="{$start_time}">
      -
      <input type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" id="end_time" name="end_time" class="input-text Wdate" style="width:120px;" autocomplete="off" value="{$end_time}">
      <input type="text" name="trade_no" id="trade_no" placeholder="订单号" style="width:250px" class="input-text" value="{$trade_no}">
      <button name="" id="" class="btn btn-success" type="submit"><i class="Hui-iconfont"></i> 搜索</button>
    </form>
  </div>
  <div class="cl pd-5 bg-1 bk-gray mt-20"> 
    <span class="r">共计：<strong>{$total_fee/100}</strong> 元</span> 
  </div>
  <input type="hidden" name="page" id="page" value="{$page}"/>
  <table class="table table-border table-bordered table-bg">
    <thead>
      <tr>
        <th>ID</th>
        <th>用户</th>
        <th>订单号</th>
        <th>价格</th>
        <th>时间</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody>
    <foreach name="order_list" item="item">
    <tr>
      <td>{$item['id']}</td>
      <td>{$item['nickname']}</td>
      <td>{$item['trade_no']}</td>
      <td>{$item['fee']/100}</td>
      <td>{$item['updated_time']|date="m-d H:i", ###}</td>
      <td>
        <a href="{:U('/admin/order/order_info', array('id' => $item['id']))}">详情</a>
      </td>
    </tr>
    </foreach>
    </tbody>
  </table>
  <div id="pager" style="margin-top:20px;"></div>
</div>
<script>
$(function(){
  $("[data-toggle='popover']").popover();
  $("[data-toggle='tooltip']").tooltip();
  var aid =$('#s_aid').val();
  var start_time =$('#start_time').val();
  var end_time =$('#end_time').val();
  var trade_no =$('#trade_no').val();
  laypage({
    cont: 'pager',
    skip: true,
    pages: {$page_count},
    curr: {$page},
    jump: function(e){
      var page = $('#page').val();
      if (page != e.curr) {
        window.location.href = "/admin/order/order_list?page=" + e.curr + '&aid=' + aid + '&start_time=' + start_time + '&end_time=' + end_time + '&trade_no=' + trade_no;
      }
    }
  });
});
</script>
</block>
